/*
 * @Author: error: git config user.name && git config user.email & please set dead value or install git
 * @Date: 2022-12-26 15:39:40
 * @LastEditors: error: git config user.name && git config user.email & please set dead value or install git
 * @LastEditTime: 2022-12-26 15:40:18
 * @FilePath: \test\src\api\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import {instance, ApiGet, ApiPost} from './request'

// /TextToVoice/gettexttovoicelan
export function gettexttovoicelan(  ) {
  return ApiGet(`/TextToVoice/gettexttovoicelan`)
}

// /TextToVoice/gettexttovoice
export function getalltexttovoice(  ) {
  return ApiGet(`/TextToVoice/getalltexttovoice`)
}

// /TextToVoice/getalltexttovoicestylebyvoiceid/{id}
export function getalltexttovoicestylebyvoiceid( id ) {
  return ApiGet(`/TextToVoice/getalltexttovoicestylebyvoiceid/${id}`)
}

// /TextToVoice/getalltexttovoicerolebyvoiceid/{id}
export function getalltexttovoicerolebyvoiceid( id ) {
  return ApiGet(`/TextToVoice/getalltexttovoicerolebyvoiceid/${id}`)
}

//  /TextToVoice/synthesize    responseType: 'blob'
export function synthesize(data) {
  return instance({
    url:`/TextToVoice/synthesize`, 
    method: 'post',
    // data:JSON.stringify(JSON.stringify(data))
    data,
    // headers: {'Content-Type': 'blob'}
    responseType: 'blob'
  })
}

//  /TextToVoice/texttovoicetest
export function texttovoicetest(data) {
  return ApiPost(`/TextToVoice/texttovoicetest`, data)
}

// /TextToVoice/getusage
export function getusage( ) {
  return ApiGet(`/TextToVoice/getusage`);
}


// /VoiceToText/getsubscription
export function getsubscription( ) {
  return ApiGet(`/VoiceToText/getsubscription`)
}

// /VoiceToText/updateusage
export function updateusage(data ) {
  return ApiPost(`/VoiceToText/updateusage`, data)
}

// /VoiceToText/getvoicetotextlan
export function getvoicetotextlan( ) {
  return ApiGet(`/VoiceToText/getvoicetotextlan`)
}

// /VoiceToText/getusage
export function VoiceToTextGetusage( ) {
  return ApiGet(`/VoiceToText/getusage`)
}
